/**
 * 路由拦截器
 */
import router from './router'
import store from './store'
const withePath = ['/login', '/register']
router.beforeEach((to, from, next) => {
    // 白名单免登录
    if (withePath.includes(to.path)) {
        next()
        return
    }
    // 判断是否登录
    if (store.getters.token) {
        next()
    } else {
        next('/login')
    }
})
